@extends('shop::layouts.master')
@section('title')
@endsection
@css(css/goods.css)
@section('tab')
    <form class="layui-form">
        <div class="goods_fax">
            <div class="layui-row">
                <div class="layui-tab layui-tab-brief" lay-filter="filter">
                    <div class="layui-tab-content">
                        {{--商品信息开始--}}
                        <div class="layui-tab-item layui-show">
                            <div class="layui-form-item">
                                <label for="L_alias" class="layui-form-label">
                                    <span class="x-red">*</span>图文详情</label>
                                <div class="layui-input-block">
                                    {!! baidu_ueditor($content, 'content') !!}
                                </div>
                            </div>

                        </div>
                        {{--商品信息结束--}}


                        <div class="layui-form-item">
                            <label for="L_repass" class="layui-form-label"></label>
                        </div>

                    </div>
                </div>
            </div>
        </div>
        <div class="layui-footer">
            <div class="layui-main">
                <button class="layui-btn" lay-filter="add" lay-submit="">提交</button>
            </div>
        </div>
    </form>
@endsection

@section('tab_js')
    @include('shop::goods.this_js')
    <script>
        layui.use(['form', 'layer', 'jquery'], function () {
            $ = layui.jquery;
            var form = layui.form,
                layer = layui.layer;

            form.render();

            //监听提交
            form.on('submit(add)', function (data) {
                var n_id = '{{$id}}';
                if(n_id){
                    data.field.id = n_id;
                }
                $.ajax({
                    url: js_url('admin-rich_text_upload'),
                    type: 'post',
                    data: data.field,
                    dataType: "json",
                    success: function (result) {
                        if (result.state === 0) {
                            layer.msg(result.msg, {time: 600, icon: 6}, function () {
                                // 可以对父窗口进行刷新
                                xadmin.father_reload();
                            });
                        } else {
                            layer.msg(result.msg, {time: 600, icon: 5});
                        }
                    }
                });
                return false;
            });

        });
    </script>
@endsection




